grammar Make;

options {
    superClass=BaseMaker;
}

@members {
	private Make生成器 生成器;
	
	public MakeParser(TokenStream input, Make生成器 生成器) {
		this(input);
		this.生成器 = 生成器;
	}
}

rules
    : {Print("开始rules");} rule+ {Print("结束rules");} EOF
    ;

tempAction
    : ACTION
    ;

rule
    : {Print("开始target");} target=ITEM {Print("结束target:" + $target.text);} ':' {Print("开始i");} (i=ITEM)* {Print("结束i:" + $i.text);} '\r'? '\n'
       ({Print("开始ACTION");} ACTION {Print("结束ACTION:" + $ACTION.text);})+ 
    | '\r'? '\n'
    ;

ITEM:  [a-zA-Z0-9_./-]+
    ;

ACTION
    :   {getCharPositionInLine()==0}? (' '|'\t') ~[\r\n]+ '\r'? '\n'
    ;

WS  :   (' '|'\t')+ -> channel(HIDDEN) 
    ;